/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ThreadClient;

import Packets.pkValue;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author ThuyHuynh
 */
public class SendComputerName {

    public static void SendInfor(ObjectOutputStream out, ObjectInputStream in) {
        try {
            pkValue str = (pkValue) in.readObject();
            String computername = InetAddress.getLocalHost().getHostName();

            str = new pkValue(2, 1, computername);
            out.writeObject(str);
            //            out.flush();
            out.flush();
            //      out.close();
            //    in.close();
            //    in.close();
        } catch (IOException ex) {
            Logger.getLogger(SendComputerName.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(SendComputerName.class.getName()).log(Level.SEVERE, null, ex);
        }


    }
}
